import request from '@/utils/request'

export function getDealBeforeDashboardInfo(params) {
  return request({
    url: '/deal/before/dashboard/getBeforeProgressInfo',
    method: 'get',
    params: params
  })
}

export function getExecuteStageChart(params) {
  return request({
    url: '/deal/before/dashboard/executeStageChart',
    method: 'get',
    params: params
  })
}

export function getChart(params) {
  return request({
    url: '/deal/before/dashboard/getChart',
    method: 'get',
    params: params
  })
}

export function getBarChart(params) {
  return request({
    url: '/deal/before/dashboard/getBarChart',
    method: 'get',
    params: params
  })
}

export function getStageChart(params) {
  return request({
    url: '/deal/before/dashboard/getStageChart',
    method: 'get',
    params: params
  })
}

export function getIndustry() {
  return request({
    url: '/deal/before/dashboard/getIndustry',
    method: 'get'
  })
}

/**
 * 获取流程节点
 * @param dealType
 * @return {*}
 */
export function getFlowNodeList(dealType) {
  return request({
    url: '/deal/before/dashboard/getFlowNodeList/' + dealType,
    method: 'get'
  })
}

export function saveFlowNodeList(nodeList) {
  return request({
    url: '/deal/before/dashboard/saveDealStage',
    method: 'post',
    data: nodeList
  })
}

